﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TianShiProject.Models.CarService.Pays;
using TianShiProject.Models.Common;
using Volo.Abp.Application.Services;

namespace TianShiProject.CarService.Pays
{
    public class PayService : ApplicationService
    {
        private readonly IPayRepository _payRepository;
        public PayService(IPayRepository payRepository)
        {
            _payRepository = payRepository;
        }
        /// <summary>
        /// 显示费用记录
        /// </summary>
        /// <param name="name"></param>
        /// <param name="time"></param>
        /// <param name="cardnumber"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public async Task<PageResponse<PayDto>> GetShowPay(string name, DateTime? time, string cardnumber, int pageindex = 1, int pagesize = 3)
        {
            return await _payRepository.GetShowPay(name, time, cardnumber, pageindex, pagesize);
        }
        /// <summary>
        /// 删除费用记录
        /// </summary>
        /// <returns></returns>
        public async Task<int> DeleteDelPay(int id)
        {
            return await _payRepository.DeleteDelPay(id);
        }
        /// <summary>
        /// 批量删除费用记录
        /// </summary>
        /// <returns></returns>
        public async Task<int> DeleteDelsPay(string ids)
        {
            return await _payRepository.DeleteDelsPay(ids);
        }
        /// <summary>
        /// 编辑修改
        /// </summary>
        /// <param name="payDto"></param>
        /// <returns></returns>
        public async Task<int> PutUpdatePay(PayDto payDto)
        {
            return await _payRepository.PutUpdatePay(payDto);
        }
        /// <summary>
        /// 添加费用记录
        /// </summary>
        /// <param name="payDto"></param>
        /// <returns></returns>
        public async Task<int> PostAddPay(PayDto payDto)
        {
            return await _payRepository.PostAddPay(payDto);
        }
    }
}
